<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jstl/core">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
	<meta name="description" content=""/>
	<meta name="author" content=""/>

	<title>Cadastrar Venda</title>

	<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="../css/bootstrap-theme.min.css" />
	<link rel="stylesheet" type="text/css" href="../css/jquery-ui-1.10.4.custom.min.css" />
	<link rel="stylesheet" type="text/css" href="../css/imotech.css" />
	
	<script type="text/javascript" src="../js/jquery-2.0.2.min.js"></script>
	<script type="text/javascript" src="../js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../js/jquery-ui-1.10.4.custom.min.js"></script>

</head>

<body>


	<f:view>
	<div class="container">

			<!-- Main jumbotron for a primary marketing message or call to action -->
			<div class="jumbotron">
				<h1>Imotech</h1>
				<p>Controle sua imobiliaria.</p>
			</div>


			<h:form role="form" styleClass="form-horizontal">
			
			<div class="page-header">
				<h4>Busca de Cliente</h4>
			</div>
			
			<div class="row">
				<div class="col-md-7">
					<label for="clienteBusca-nome" class="col-sm-2 control-label">Nome:</label>
					<div class="col-sm-10">
						<h:inputText value="#{clienteBusca.nome}" styleClass="form-control" id="clienteBusca-nome">
    	    			</h:inputText>
					</div>
				</div>
				<div class="col-md-5">
					<div class="col-sm-2">
						<h:commandButton value="Buscar" styleClass="btn btn-default"></h:commandButton>
					</div>
				</div>
			</div>
			
			<div class="page-header">
				<h4>Escolha um Cliente</h4>
			</div>
			
				<table class="table table-stripped">
					<thead>
						<tr>
							<th>Nome</th>
							<th>E-mail</th>
							<th>Telefone</th>
							<th></th>
						</tr>
					</thead>

					<tbody>
						<ui:repeat value="#{clienteBusca.clientes}" var="cadaCliente">
							<tr>
								<td><h:commandLink
										action="#{aluguelMB.selecionaCliente(cadaCliente.id)}"
										value="#{cadaCliente.nome}">
									</h:commandLink></td>
								<td><h:outputText value="#{cadaCliente.email}" /></td>
								<td><h:outputText value="#{cadaCliente.telefone}" /></td>
								<td></td>
							</tr>
						</ui:repeat>
					</tbody>
				</table>
			
			
				<div class="col-sm-3">
					<h:commandLink action="#{clienteMB.cadastrarCliente}">
						<h:outputText value="Cadastrar novo cliente" styleClass="btn btn-primary"></h:outputText>
					</h:commandLink>
				</div>
			
			
			</h:form>
			
			
		</div>
		<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
		<script
			src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
	</f:view>
</body>
</html>
